﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.Collections.Generic;

namespace NDF.Tests.Framework.MEF
{
    [TestClass]
    public class MEFTest
    {
        private CompositionContainer _container;


        [ImportMany]
        public List<IUser> Users { get; set; }

        [TestMethod]
        public void TestMethod1()
        {
            var catalog = new AggregateCatalog();
            catalog.Catalogs.Add(new AssemblyCatalog(typeof(MEFTest).Assembly));

            _container = new CompositionContainer(catalog);

            this._container.ComposeParts(this);

            Console.WriteLine(this.Users[0]);
        }
    }
}
